package org.nepu.scr.indexrate.converter.compliancerate.naturesecurity;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.compliancerate.naturesecurity.PreA32;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class PreA32Converter implements AttributeConverter<PreA32, String> {
    @Override
    public String convertToDatabaseColumn(PreA32 preA32) {
        return JSONUtil.toJsonStr(preA32);
    }

    @Override
    public PreA32 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, PreA32.class);
    }
}
